package com.medusa.aps.business.modules.plan.mp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medusa.aps.business.model.pagination.Page;
import com.medusa.aps.business.modules.demand.model.input.ControlDetailParam;
import com.medusa.aps.business.modules.demand.model.output.ScheduleDetailSelfModel;
import com.medusa.aps.business.modules.plan.mp.entity.SuggestedPlan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 建议计划数据库访问层
 *
 * @author yuxh
 * @since 2023-08-14 17:37:50
 */
public interface SuggestedPlanMapper extends BaseMapper<SuggestedPlan> {
    boolean saveForBatch(@Param("suggestedPlans") List<SuggestedPlan> suggestedPlans);

    /**
     * 查询自制生产排程明细
     *
     * @param controlDetailParam 查询参数
     * @param page               分页参数
     * @return 查询列表
     */
    Page<ScheduleDetailSelfModel> selfControl(@Param("param") ControlDetailParam controlDetailParam, @Param("page") Page<ScheduleDetailSelfModel> page);

    /**
     * 查询与订单集合相匹配的建议计划
     *
     * @param orderNumberList 订单集合
     * @return 建议计划List
     */
    List<SuggestedPlan> selectSuggestedPlanListByOrderNumber(@Param("orderNumberList") List<String> orderNumberList);
}

